Add embedded test for object-storage-encoding format for nested field#18818
Add embedded test for object-storage-encoding format for nested field#18818cecemei merged 19 commits intoapache:masterfrom
Conversation
services/src/test/java/org/apache/druid/testing/embedded/EmbeddedClusterApis.java
Outdated
Show resolved
Hide resolved
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
processing/src/main/java/org/apache/druid/query/http/ClientSqlQuery.java
Outdated
Show resolved
Hide resolved
services/src/test/java/org/apache/druid/testing/embedded/indexing/Resources.java
Outdated
Show resolved
Hide resolved
processing/src/test/java/org/apache/druid/segment/TestDataSource.java
Outdated
Show resolved
Hide resolved
services/src/test/java/org/apache/druid/testing/embedded/EmbeddedClusterApis.java
Outdated
Show resolved
Hide resolved
| <failsOnError>true</failsOnError> | ||
| <excludes> | ||
| *com/fasterxml/jackson/databind/* | ||
| *com/fasterxml/jackson/databind/*,**/NestedDataFormatsTest.java |
There was a problem hiding this comment.
Why is the new test excluded from checkstyle?
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
| final String scanQuery = "select event, to_json_string(agent) as agent from %s where json_value(event, '$.type') = 'PercentClear' and json_value(agent, '$.os') = 'Android' order by __time asc limit 1"; | ||
| final String scanQueryResultDefaultFormat = cluster.callApi().runSql(scanQuery, defaultFormat); | ||
| final String scanQueryResultNoneObjectStorage = cluster.callApi().runSql(scanQuery, dataSource); | ||
| // CHECKSTYLE: text blocks not supported in current Checkstyle version |
There was a problem hiding this comment.
Let's consider updating the checkstyle version in that case.
There was a problem hiding this comment.
only later version of checkstyle support the """ style (java 15+), and had to exclude this file since the error thrown was parsing error. in the later version of checkstyle a bunch of other things failed as well, so prefer to make checkstyle a separate pr besides this one.
There was a problem hiding this comment.
Okay, thanks for the details.
I think you can also use // CHECKSTYLE.OFF to turn off checkstyle without having to exclude the entire file in pom. e.g. see StringUtils class.
There was a problem hiding this comment.
it still complains about error, i think parsing was before style check
Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:checkstyle (default-cli) on project druid-embedded-tests: An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: Exception was thrown while processing /Users/cecemei/codespace/bitmap/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java: IllegalStateException occurred while parsing file /Users/cecemei/codespace/bitmap/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java. /Users/cecemei/codespace/bitmap/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java:118:5: unexpected token: Assertions -> [Help 1]
There was a problem hiding this comment.
I see, thanks for checking. Let's just exclude it in the pom until we upgrade the checkstyle version in the follow up PR.
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
...ed-tests/src/test/java/org/apache/druid/testing/embedded/indexing/NestedDataFormatsTest.java
Outdated
Show resolved
Hide resolved
…/indexing/NestedDataFormatsTest.java Co-authored-by: Kashif Faraz <kashif.faraz@gmail.com>
…/indexing/NestedDataFormatsTest.java Co-authored-by: Kashif Faraz <kashif.faraz@gmail.com>
Updated, please take another look, thx! |
| cluster.callApi().waitForAllSegmentsToBeAvailable(dataSource, coordinator, broker); | ||
|
|
||
| // Test ingesting with skipping raw json smile format works, same row count, with ~20% storage saving | ||
| final String metadata = "select sum(num_rows), sum(size) from sys.segments where datasource = '%s' group by datasource"; |
There was a problem hiding this comment.
I think the GROUP BY clause can be omitted.
| final String metadata = "select sum(num_rows), sum(size) from sys.segments where datasource = '%s' group by datasource"; | |
| final String metadataSql = "select sum(num_rows), sum(size) from sys.segments where datasource = '%s'"; |
| Assertions.assertEquals(queryResultDefaultFormat, queryResultNoneObjectStorage); | ||
|
|
||
| // Test reconstruct json column works, the ordering of the fields has changed, but all values are perserved. | ||
| final String scanQuery = "select event, to_json_string(agent) as agent from %s where json_value(event, '$.type') = 'PercentClear' and json_value(agent, '$.os') = 'Android' order by __time asc limit 1"; |
There was a problem hiding this comment.
Please try to break the SQL string into multiple lines.
|
Hey folks, looks like this updated to JDK 17 compiler. This was a change previously reverted here: #18759 as it breaks a few things. |
Description
Add embedded test for object-storage-encoding format for nested field.
This PR has: